﻿let data={
    msg:{
        name:'赖志勋',
        id:'1903010316',
        class:'19应用3-3班'
    },
    ImgColor:['#FAF0E6','#FFEBCD','#9BCD9B','#CDCD00'],
    ImgSrc:['fig1.jpg','fig2.jpg','fig3.jpg','fig1.jpg']
}

let tempDIV = document.querySelectorAll('#div1 div')
console.log(tempDIV[0])
tempDIV[0].textContent=data.msg.class
tempDIV[1].textContent=data.msg.id
tempDIV[2].textContent=data.msg.name

let tempdiv2 = document.querySelectorAll('#div2 div')
console.log(tempdiv2[0])
tempdiv2[0].style.background=data.ImgColor[0]
tempdiv2[1].style.background=data.ImgColor[2]
tempdiv2[2].style.background=data.ImgColor[2]
tempdiv2[3].style.background=data.ImgColor[3]

let Ele = document.querySelectorAll('#div3 div')
console.log(Ele)

for(let i=0;i<data.ImgSrc.length;i++){
    //NEWEle.src=data.ImgSrc[0]
    //console.log(NEWEle)
    let NEWEle=document.createElement('img')
    NEWEle.src=data.ImgSrc[i]
    console.log(NEWEle)
    Ele[i].textContent=''
    Ele[i].appendChild(NEWEle)
}








